-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init category indexer #858
base: develop
Are you sure you want to change the base?
Conversation
…n of logic for new indexer
…ento2 into feature/category-indexer
Model/Category/Repository.php
Outdated
public function getCategoryCollectionQuery(Store $store, array $categoryIds = []) | ||
{ | ||
$categories = $this->categoryCollectionFactory->create() | ||
->distinct(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can ignore this CS error, since we don't want duplicate ID's
* | ||
* @param array $ids | ||
*/ | ||
public function getByIds(array $ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this method if it is not being used
{ | ||
$this->parentCategoryIdCache[$category->getId()] = $parentCategoryIds; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Model/Indexer/Dimensions/ModeSwitcher/ModeSwitcherConfiguration.php
Outdated
Show resolved
Hide resolved
{ | ||
$store = $this->nostoScopeHelper->getStore($storeId); | ||
$categoryCollection = $this->collectionFactory->create() | ||
->addIdsToFilter($categoryIds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to inherit from Magento\Catalog\Model\ResourceModel\Category
and create this method, so we can filter by ID when calling the export controller
/** @var CategoryInterface $category */ | ||
foreach ($collection->getItems() as $category) { | ||
try { | ||
$parents = $this->nostoCategoryRepository->resolveParentCategoryIds($category); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if instanceof...
…ento2 into feature/category-indexer
$productCollection = $this->collectionFactory->create() | ||
->addIdsToFilter($productIds) | ||
->addStoreFilter($storeId); | ||
$this->syncService->syncProducts($productCollection, $store); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ugljesaspx
You're sending categories, not products. Please check this properly and which syncService is this, should be a syncService for categories, not products.
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Documentation:
Checklist: